import React from "react";
import {Form, Input, Button} from 'antd'
import {UserOutlined, LockOutlined} from '@ant-design/icons'
import './style/index.css'


export default class extends React.Component {

    onLogin = (values) => {
        console.log(values)
    }

    render() {
        return <div className="m-login">

            <Form onFinish={this.onLogin}>
                <h4>登录</h4>
                <Form.Item name="username" rules={[{required: true, message: '请输入用户名'}]}>
                    <Input prefix={<UserOutlined/>} placeholder="请输入账号"/>
                </Form.Item>
                <Form.Item name="password" rules={[{required: true, message: '请输入密码'}]}>
                    <Input prefix={<LockOutlined/>} placeholder="请输入账号"/>
                </Form.Item>
                <Form.Item>
                    <Button block type={'primary'} htmlType={"submit"}>登录</Button>
                </Form.Item>
            </Form>
        </div>
    }
}